@extends('admin.layout.main')

@section('content')
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="#">币种管理</a>
	</li>
	<li class="active"><a href="{{ url('admin/currency_recharge_info') }}">充币记录</a></li>
</ul><!-- /.breadcrumb -->

<div class="nav-search" id="nav-search">
	<form class="form-search">
		<span class="input-icon">
		<input type="text" placeholder="搜索" class="nav-search-input" id="nav-search-input" autocomplete="off" />
			<i class="ace-icon fa fa-search nav-search-icon"></i>
		</span>
	</form>
</div><!-- /.nav-search -->
</div>
<div class="page-content">
	<div class="row">
		<div class="col-xs-12">
			<div class="row">
				<div class="search-area well col-xs-12">
					<form action="">
						<div class="pull-left">
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<b class="text-primary">会员ID: </b>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<input type="text" name="account"/>
							</div>
							&nbsp;
							<div id="toggle-result-format" class="btn-group btn-overlap" data-toggle="buttons">
								<select class="" name="cid">
									<option value='0'>全部</option>
									@foreach($currs as $v)
										<option value="{{$v->id}}">{{$v->name_en}}</option>
									@endforeach
								</select>
							</div>

							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<button type="submit" class="btn btn-white btn-info btn-bold">查询</button>
						</div>
					</form>
				</div>
			</div>
			<!-- PAGE CONTENT BEGINS -->
			<div class="row">
				<div class="col-xs-12">
					<div class="clearfix">
						<div class="pull-right tableTools-container"></div>
					</div>
					<div class="table-header">

					</div>

					<!-- div.table-responsive -->

					<!-- div.dataTables_borderWrap -->
					<div>
						<table id="dynamic-table" class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>序号</th>
									<th>用户ID</th>
									<th>用户账号</th>
									<th>充值币种</th>
									<th>转入钱包地址</th>
									<th>转入数量</th>
									<th>转入确认时间</th>
									<th>状态</th>
									<th class="hidden-480" align="center">操作</th>

									{{--<th></th>--}}
								</tr>
							</thead>

							<tbody>
							@if(collect($data)->count() > 0)
							@foreach($data as $key=>$val)
								<tr align="center">
									<td align="center">
										<a href="#">{{$key+1}}</a>
									</td>
									<td align="center">{{$val->user->account}}</td>
									<td align="center">{{$val->user->email ?? $val->user->phone}}</td>
									<td align="center">{{$val->currency->name_en}}</td>
									<td  align="center">
										{{$val->wallet->address}}
									</td>
									<td align="center">{{$val->real_num}}</td>
									<td align="center">
										{{$val->updated_at}}</td>
									<td  align="center">
										{{\App\Models\Turn::$STATUS[$val->status]}}
									</td>

									<td><div class="hidden-sm hidden-xs action-buttons">
											{{--<a class="blue" href="#">--}}
												{{--<i class="ace-icon fa fa-search-plus bigger-130"></i>--}}
											{{--</a>--}}
											{{--<a href="admin-index-control_del?id={{$val->admin_id}}">删除</a>--}}

											{{--@if($val->status !=1 and $val->status !=5)
												<a class="green" href="entrust_details?id={{$val->id}}">
													<i class="ace-icon fa fa-pencil bigger-130">查看</i>{{csrf_field()}}
												</a>
											@endif--}}
											@if($val->status==1)
												<a href="javascipt:void(0)" class="red" onclick="undo({{$val->id}},2)">
													<i class="ace-icon fa fa-trash-o bigger-130">全部撤销</i>
												</a>
											@endif
											<!--@if($val->status==2)
												<a href="javascipt:void(0)" class="red" onclick="undo({{$val->id}},1)">
													<i class="ace-icon fa fa-trash-o bigger-130">部分撤销</i>
												</a>
											@endif-->

										</div>

										<div class="hidden-md hidden-lg">
											<div class="inline pos-rel">
												<button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown" data-position="auto">
													<i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
												</button>

												<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
													{{--<li>--}}
														{{--<a href="#" class="tooltip-info" data-rel="tooltip" title="View">--}}
															{{--<span class="blue">--}}
																{{--<i class="ace-icon fa fa-search-plus bigger-120"></i>--}}
															{{--</span>--}}
														{{--</a>--}}
													{{--</li>--}}

													<li>
														<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
															<span class="green">
																<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
															</span>
														</a>
													</li>

													{{--<li>--}}
														{{--<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">--}}
															{{--<span class="red">--}}
																{{--<i class="ace-icon fa fa-trash-o bigger-120"></i>--}}
															{{--</span>--}}
														{{--</a>--}}
													{{--</li>--}}
												</ul>
											</div>
										</div>
									</td>
								</tr>
							@endforeach
							@endif

							</tbody>
						</table>
					</div>
				</div>
			</div>
			<!-- PAGE CONTENT ENDS -->
		</div><!-- /.col -->

		<div class="modal-footer no-margin-top">
			{{ $data->appends(['account'=>$account,'cid'=>$cid])->links() }}
		</div>
	</div><!-- /.row -->
</div><!-- /.page-content -->
	<script>

        //询问框
        // layer.confirm('您是如何看待前端开发？', {
        //     btn: ['重要','奇葩'] //按钮
        // }, function(){
        //     layer.msg('的确很重要', {icon: 1});
        // }, function(){
        //     layer.msg('也可以这样', {
        //         time: 20000, //20s后自动关闭
        //         btn: ['明白了', '知道了']
        //     });
        // });
        function undo(id,type){
            layer.confirm('确认撤销?',{
                btn: ['确定','取消'] //按钮
            },function(){
                $.ajax({
                    url:'/admin/entrust_undo?id=id&type=type',
                    type : "get",
                    data:{ id : id,type:type },
                    //dataType:'array',
                    success:function(res){
                        //window.print(res)
                        if(res.status == 1){
                            layer.msg( res.msg, {icon: 1});
                            location.href= '/admin/entrust_list'
                        }else {
                            layer.msg( res.msg, {icon: 2});
                        }
                    }
                });
            },function(){
                //取消
            })}
	</script>

@endsection
